00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef XCOMBOLIST_H
00016 #define XCOMBOLIST_H
00017
00018 extern UINT NEAR WM_XCOMBOLIST_VK_RETURN;
00019 extern UINT NEAR WM_XCOMBOLIST_VK_ESCAPE;
00020 extern UINT NEAR WM_XCOMBOLIST_KEYDOWN;
00021 extern UINT NEAR WM_XCOMBOLIST_LBUTTONUP;
00022
00023
00024
00025
00026 class CXComboList : public CWnd
00027 {
00028
00029 public:
00030 CXComboList(CWnd *pParent);
00031 virtual ~CXComboList();
00032
00033
00034 public:
00035
00036
00037 public:
00038 void SetActive(int nScrollBarWidth);
00039
00040 int AddString(LPCTSTR lpszItem)
00041 {
00042 return m_ListBox.AddString(lpszItem);
00043 }
00044 int GetCount()
00045 {
00046 return m_ListBox.GetCount();
00047 }
00048 void GetText(int nIndex, CString& rString)
00049 {
00050 m_ListBox.GetText(nIndex, rString);
00051 }
00052 int FindStringExact(int nIndexStart, LPCTSTR lpszFind)
00053 {
00054 return m_ListBox.FindStringExact(nIndexStart, lpszFind);
00055 }
00056 int SetCurSel(int nSelect)
00057 {
00058 return m_ListBox.SetCurSel(nSelect);
00059 }
00060 int GetCurSel()
00061 {
00062 return m_ListBox.GetCurSel();
00063 }
00064 void SetFont(CFont* pFont, BOOL bRedraw = TRUE)
00065 {
00066 m_ListBox.SetFont(pFont, bRedraw);
00067 }
00068
00069
00070
00071
00072 public:
00073 virtual BOOL PreTranslateMessage(MSG* pMsg);
00074 virtual CScrollBar* GetScrollBarCtrl(int nBar);
00075
00076
00077
00078 protected:
00079 CListBox m_ListBox;
00080 CScrollBar m_wndSBVert;
00081 CWnd * m_pParent;
00082 int m_nCount;
00083 BOOL m_bFirstTime;
00084
00085 void SendRegisteredMessage(UINT nMsg, WPARAM wParam, LPARAM lParam);
00086
00087
00088 protected:
00089
00090 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00091 afx_msg void OnKillFocus(CWnd* pNewWnd);
00092 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00093 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00094 afx_msg void OnDestroy();
00095 afx_msg void OnTimer(UINT nIDEvent);
00096
00097
00098 DECLARE_MESSAGE_MAP()
00099 };
00100
00101
00102
00103
00104
00105
00106 #endif //XCOMBOLIST_H